package com.ww.editsms.entity;

import java.util.List;

import android.graphics.Bitmap;
import android.os.Parcel;
import android.os.Parcelable;

public class Person implements Parcelable {

	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeLong(this.id);
		dest.writeString(this.name);
		dest.writeString(this.number);
		dest.writeString(this.count);
		dest.writeString(this.desc);
		dest.writeString(this.time);

		this.id = id;
		// this.photo = photo;
		this.name = name;
		this.number = number;
		this.count = count;
		this.desc = desc;
		this.time = time;
	}

	public static final Parcelable.Creator<Person> CREATOR = new Creator<Person>() {
		@Override
		public Person[] newArray(int size) {
			return new Person[size];
		}

		@Override
		public Person createFromParcel(Parcel source) {
			Person p = new Person();
			p.id = source.readLong();
			p.name = source.readString();
			p.number = source.readString();
			p.count = source.readString();
			p.desc = source.readString();
			p.time = source.readString();
			return p;
		}
	};

	public Person() {
		super();
		// TODO Auto-generated constructor stub
	}

	public Person(long id, Bitmap photo, String name, String number,
			String count, String desc, String time) {
		super();
		this.id = id;
		// this.photo = photo;
		this.name = name;
		this.number = number;
		this.count = count;
		this.desc = desc;
		this.time = time;
	}

	private long id;
	private Bitmap photo;
	private String name;
	private String number;
	private String count;
	private String desc;
	private String time;
	private List<SMS> smsList;

	public List<SMS> getSmsList() {
		return smsList;
	}

	public void setSmsList(List<SMS> smsList) {
		this.smsList = smsList;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public Bitmap getPhoto() {
		return photo;
	}

	public void setPhoto(Bitmap photo) {
		this.photo = photo;
	}

	public String getName() {
		// if (name == null || "".equals(name) || "null".equals(name)) {
		// return number;
		// }
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getNumber() {
		return number;
	}

	public void setNumber(String number) {
		this.number = number;
	}

	public String getCount() {
		return count;
	}

	public void setCount(String count) {
		this.count = count;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public String getTime() {
		return time;
	}

	public void setTime(String time) {
		this.time = time;
	}

}
